package cate.game.play.buff.h;


import cate.game.attr.FightAttr;
import cate.game.play.buff.BuffHandler;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.ActionCtx;
import easy.java.dev.note.NoteClass;

@NoteClass("属性效率变更BH")
public class 属性效率变更BH extends BuffHandler {

    private int 属性;
    private double 效率;

    //属性=？？&效率=？？？
    @Override
    public void parse(String code) {
        PlayCfgArgs args = new PlayCfgArgs(code);
        属性 = args.getInt("属性", 0);
        效率 = args.getWDouble("效率", 0d);
    }

    private FightAttr attr = new FightAttr();

    @Override
    public void onAdd(ActionCtx action) {
        attr.add(属性, buff.owner.attr.total().getTotalValue(属性) * 效率);
        this.buff.owner.attr.addAttr(this.attr, true, action);
    }

    @Override
    public void onInvalid(ActionCtx action, byte invalidReason) {
        this.buff.owner.attr.addAttr(this.attr, false, action);
    }
}
